﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin.Master" AutoEventWireup="true" CodeBehind="ShopList.aspx.cs" Inherits="yedian.ShopList" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        $(function () {


            $("#Div5").dialog({
                bgiframe: true,
                autoOpen: false,
                width: 550,
                height: 400,
                modal: true,
                resizable: false,
                buttons: {
                    " 关闭 ": function () {
                        $(this).dialog("close");
                    },
                    " 确定 ": function () {
                        var _Pwd = $("#paixu").val();
                        if (_Pwd == "" || _Pwd == null) {
                            ShowDialog("排序不能为空!");
                            return;
                        }
                        else {
                            if (!/^-?[0-9]\d*$/.test(_Pwd)) {
                                ShowDialog("排序格式错误!");
                                return;
                            }
                        }
                        $.ajax({
                            type: "POST",
                            url: "Handler.r",
                            dataType: "json",
                            async: false,
                            data: {
                                typename: "sethot",
                                paixu: $.trim($("#paixu").val()),
                                Id: AdminId
                            },
                            success: function (msg) {
                                if (msg.success == "true") {
                                    ShowDialogInfoG("设置成功", window.location.href);
                                }
                                else {
                                    ShowDialog(msg.msg);
                                    _pass = false;
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                            }
                        });
                    }
                }
            });
        });
        var AdminId = "";
        function setremen(id, num, name) {
            AdminId = id;
            $("#dd").text(name);
            $("#paixu").val(num);
            $('#Div5').dialog('option', 'title', "设置热门");
            $('#Div5').dialog('open');
        }
        function cancelremen(id) {
            $.ajax({
                type: "POST",
                url: "Handler.r",
                dataType: "json",
                async: false,
                data: {
                    typename: "cancelhot",
                    Id: id
                },
                success: function (msg) {
                    if (msg.success == "true") {
                        ShowDialogInfoG("取消成功", window.location.href);
                    }
                    else {
                        ShowDialog(msg.msg);
                        _pass = false;
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                }
            });
        }
        function dels(id) {
            if (confirm("确定要禁用当前商家吗？")) {
                $.ajax({
                    type: "POST",
                    url: "Handler.r",
                    dataType: "json",
                    async: false,
                    data: {
                        typename: "jinyongShop",
                        Id: id
                    },
                    success: function (msg) {
                        if (msg.success == "true") {
                            ShowDialogInfoG("禁用成功", window.location.href);
                        }
                        else {
                            ShowDialog(msg.msg);
                            _pass = false;
                        }
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                    }
                });
            }
        }
    </script>
    <div style="height:100%">
        <div id="breadcrumb">
            <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i>Home</a>
            <a href="#" class="current">商家管理</a></div>
         <table width="88%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td class="STYLE6" align="left" style="width: 350px; height: 45px;">
                &nbsp;商家名称： &nbsp;<asp:TextBox ID="UserName" Width="180px" runat="server"></asp:TextBox>
            </td>
            <td align="left">
               热点:<select id="remensele" runat="server" style="width: 150px;">
                   <option value="">全部</option>
                <option value="0">否</option>
                <option value="1">是</option>
            </select>&nbsp;<asp:Button
                    ID="Button1" runat="server"  class="btn btn-success" Text="查询" OnClick="Button1_Click" />
            </td>
        </tr>
    </table>

    <table rules="cols" class="table" width="100%" border="0" cellpadding="0" cellspacing="1">
        <asp:Repeater ID="rptlist" runat="server" EnableViewState="false">
            <HeaderTemplate>
                <tr style=" height: 25px;" class="STYLE5">
                    <td style=" width:100px;">微信编号
                    </td>
                    <td style=" width:140px;">封面
                    </td>
                    <td style=" width:120px;">名称
                    </td>
                    <td style=" width:200px;">地址
                    </td>
                    <td style=" width:80px;">状态
                    </td>
                    <td style="width: 120px;">注册时间
                    </td>
                    <td>操作</td>
                </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="tdwwbackground STYLE5">
                    <td style="height: 32px;"><%# Eval("openid")%></td>
                    <td style="height: 75px;">&nbsp;&nbsp;
                    <img id="shop_fm" width="85%" height="70px" src="<%# Eval("shopFrontCover")%>"/></td>
                    <td style="height: 32px;"><%# Eval("shopName")%></td>
                    <td style="height: 32px; word-wrap: break-word;word-break: normal;"><%# Eval("address")%></td>
                    <td style="height: 32px; word-wrap: break-word;word-break: normal;"><%# sfrzs(Eval("isForbidden").ToString())%></td>
                    <td style="height: 32px;word-wrap: break-word;word-break: normal;"><%# Eval("createTime").ToString().Trim()%></td>
                    <td style="height: 32px;"><a href="KazuoList.aspx?sid=<%# Eval("suid")%>&name=<%# Eval("shopName")%>&">查看卡座</a>&nbsp;&nbsp;|&nbsp;&nbsp;<%# remen(Eval("suid").ToString(),Eval("isRemen").ToString(),Eval("sequence").ToString(),Eval("shopName").ToString())%>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:;" onclick="dels('<%# Eval("suid")%>')">禁用</a></td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
    </table>
           <Yd:PageButton ID="PageBtn" runat="server" />

    </div>
     <div id="Div5" title=" 设为热点商家 " style="text-align: left">
        <table width="100%" height="90%" border="0" cellpadding="0" cellspacing="1" bgcolor="#b5d6e6"
            align="center">
            <tr >
                <td style="height: 25px;" class="STYLE7">商家:
                </td>
                <td class="STYLE2" style="padding: 3px;">
                    <span id="dd"></span>
                </td>
            </tr>
            <tr>
                <td style="height: 25px;" class="STYLE7">排序:
                </td>
                <td class="STYLE2" style="padding: 3px;">
                     <input type="text" maxlength="30" id="paixu" style="width: 180px;" value="0" />
                </td>
            </tr>
            <tr>
                <td style="height: 25px;" class="STYLE7">说明:
                </td>
                <td class="STYLE2" style="padding: 3px;">
                    <span>排序越小在用户端首页显示越靠前</span>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
